﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SeaBattle.Domain.Entities;

namespace SeaBattle.Domain.Abstract
{
    public interface IGameRepository
    {
        /// <summary>
        /// Creates new game instance. 
        /// </summary>
        /// <param name="creator">game owner</param>
        /// <returns>created game instance</returns>
        Game CreateNewGame(Player creator);

        /// <summary>
        /// Saves current game instance.
        /// </summary>
        /// <param name="game">game instance</param>
        /// <returns>successful saving flag</returns>
        bool SaveGame(Game game);

        /// <summary>
        /// Loads the game.
        /// </summary>
        /// <param name="id">id of the game</param>
        /// <returns></returns>
        Game GetGame(int id);

        /// <summary>
        /// Gets games collections.
        /// </summary>
        /// <returns></returns>
        IEnumerable<Game> GetAllGames();
    }
}
